package com.zhdl.modules.process.verify;

import com.zhdl.hardware_contact.hardware_config.entity.ProjectConfiguration;
import com.zhdl.modules.mnt.repository.Test;
import com.zhdl.modules.process.common.GetPLCValue;
import com.zhdl.modules.process.common.ProcessVerify;

public class PlCBitValueVerify implements ProcessVerify {
    private final GetPLCValue getPLCValue;
    private final String filed;

    boolean isTest = true;

    public PlCBitValueVerify(GetPLCValue getPLCValue, String filed) {
        this.getPLCValue = getPLCValue;
        this.filed = filed;
    }
    int count = 0;
    @Override
    public boolean verity() {
        count++;
        if (isTest){
            if (count>=30) {
                return true;
            }
        }
        ProjectConfiguration value = getPLCValue.getValue(filed);
        if (value.getValueType() == 1) {
            return value.getValue().equals("1");
        }
        return false;
    }
}
